import { defineStore } from "pinia"
import { addressData } from '../api/store.js'
 
export const carInfoStore = defineStore('carInfo', {
  state: () => ({
    store: {},
    cart: [],
    orderType: 'takein',
    address: {},
	addresses: [],
    member: {},
    order: {}
  }),
  getters: {
  	isLogin: state => Object.keys(state.member).length > 0	//是否登录
  },
  actions: {
  	getStore() {
		this.store = addressData
  	},
	getOrderType(item){
		console.log('takein:',item)
		this.orderType = item
	}
  }
})